﻿using System;

namespace YArchitech.Plumbing
{
	public class HYRiserRange
	{
		public HYRiserRange(int dn, double ventilQ, double noVentilQ)
		{
			this.nDN = dn;
			this.dVentilQ = ventilQ;
			this.dNoVentilQ = noVentilQ;
		}

		public static int ComperByDN(HYRiserRange ris1, HYRiserRange ris2)
		{
			if (ris1 == null || ris2 == null)
			{
				return 0;
			}
			if (ris1 == null)
			{
				return -1;
			}
			if (ris2 == null)
			{
				return 1;
			}
			if (ris1.nDN > ris2.nDN)
			{
				return 1;
			}
			if (ris1.nDN == ris2.nDN)
			{
				return 0;
			}
			return -1;
		}

		public static int ComperByQ(HYRiserRange ris1, HYRiserRange ris2)
		{
			if (ris1 == null || ris2 == null)
			{
				return 0;
			}
			if (ris1 == null)
			{
				return -1;
			}
			if (ris2 == null)
			{
				return 1;
			}
			if (ris1.dVentilQ > ris2.dVentilQ)
			{
				return 1;
			}
			if (ris1.dVentilQ == ris2.dVentilQ)
			{
				return 0;
			}
			return -1;
		}

		public static int ComperByNoQ(HYRiserRange ris1, HYRiserRange ris2)
		{
			if (ris1 == null || ris2 == null)
			{
				return 0;
			}
			if (ris1 == null)
			{
				return -1;
			}
			if (ris2 == null)
			{
				return 1;
			}
			if (ris1.dNoVentilQ > ris2.dNoVentilQ)
			{
				return 1;
			}
			if (ris1.dNoVentilQ == ris2.dNoVentilQ)
			{
				return 0;
			}
			return -1;
		}

		public int nDN;

		public double dVentilQ;

		public double dNoVentilQ;
	}
}
